package com.ynhenc.pta.routeRank;

import com.ynhenc.comm.ArrayListEx;
import com.ynhenc.pta.routeRank.*;

/** 
 * 
 * @author sbmoon
 */
public class SectionList extends ArrayListEx<Section> {

	public double getExtraQueryTime_Sec() {
		return extraQueryTime_Sec;
	}

	public void setExtraQueryTime_Sec(double extraQueryTime_Sec) {
		this.extraQueryTime_Sec = extraQueryTime_Sec;
	}
	
	public double getQeuryTime_Sec() {
		double sum = 0 ;
		for( Section section: this ) {
			sum += section.getQueryTime_Sec();
		}
		return sum;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -6004835575870983288L;
	
	public double getCurveDistance_Meter() {
		double sum = 0;
		for( Section section : this ) {
			sum += section.getLength_Meter();
		}
		return sum;
	}
	
	public void setTransitType( TransitType transitType ) {
		for( Section section : this ) {
			section.setTransitType(transitType);
		}
	}
	
	public Node getNodeStart() {
		Section section = this.getStart();
		if( section != null ) {
			return section.getNodeStart();
		} else {
			return null;
		}
	}
	
	public Node getNodeEnd() {
		Section section = this.getEnd();
		if( section != null ) {
			return section.getNodeEnd();
		} else {
			return null;
		}
	} 
	
	private double extraQueryTime_Sec;
	
}
